import request from './index'
// 是否全局消息提示
const requestOptions = {
  globalErrorMessage: true,
  globalSuccessMessage: true
}

// 查询所有分类
export function getAllCategories(data?: any) {
  return request.get('categories', {
    requestOptions
  })
}
// 查询商品分类列表
export function getCategoriesList(data?: any) {
  return request.get(`categories?pageNum=${data.pageNum}&pageSize=${data.pageSize}&level=${data.level}`, {
    requestOptions
  })
}

// 查询动态参数属性
export function getCategoryByParams(data?: any) {
  return request.get(`categories/${data.id}/attributes?sel=${data.sel}`, { requestOptions })
}
